Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(release): v0.98.0 @ master #3521

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fuel-service-user
Copy link
Contributor

@fuel-service-user fuel-service-user commented Jan 2, 2025

Summary

In this release, we:

  • Added method fromInstance to the Predicate class
  • Added auto-detection for the user's package manager of choice for create fuels
  • Made Provider constructor public and sync again
  • Added support for --fuel-core-port flag in fuels init command
  • Added a frictionless subscription endpoint for submitting transactions and obtaining it's status
  • Added the autoCost method to easily estimate and fund transactions
  • Migrated fundWithRequiredCoins -> autoCost for contract and script calls
  • Fixed an issue when using multiple paths (or globals) in fuels init
  • Improved validation and handling of unsafe integers in BigNumberCoder
  • Upgraded fuel-core to 0.40.2
  • Removed unused operations from OperationName enum
  • Remove receipts deprecated properties
  • Removed all receipt coders
  • Removed all instances of Bech32 address format in favour of B256
  • Removed the AbstractAddress in favour of the Address class.
  • Improved Getting Started docs and repo README, focusing on Mainnet

Breaking


Features

Fixes

Chores

Docs


Migration Notes

Features

#3514 - Making provider initialization sync again

1. Provider Instantiation

  • Going from async to sync
// before
const provider = await Provider.create(NETWORK_URL);
// after
const provider = new Provider(NETWORK_URL);

2. Provider methods

  • The following methods are now async
// before
provider.getNode();
provider.getChain();
provider.getChainId();
provider.getBaseAssetId();
provider.getGasConfig();
provider.validateTransaction();
// after
await provider.getNode();
await provider.getChain();
await provider.getChainId();
await provider.getBaseAssetId();
await provider.getGasConfig();
await provider.validateTransaction();

3. TransferParams and ContractTransferParams

export type TransferParams = {
  destination: string | AbstractAddress;
  amount: BigNumberish;
-  assetId?: BytesLike;
+  assetId: BytesLike;
};

export type ContractTransferParams = {
  contractId: string | AbstractAddress;
  amount: BigNumberish;
-  assetId?: BytesLike;
+  assetId: BytesLike;
};

4. Transaction Response

  • The constructor now requires a chainId
// before
new TransactionResponse('0x..', provider);
// after
new TransactionResponse('0x..', provider, chainId);

#3539 - autoCost for transaction estimation and funding

To be brought inline with autoCost, funding a contract and script call has been migrated from fundWithRequiredCoins to autoCost:

// before
const request: ScriptTransactionRequest = contract.functions.add(1).fundWithRequiredCoins();

// after
const request: ScriptTransactionRequest = contract.functions.add(1).autoCost(wallet);

Chores

#3553 - Remove unused operations

The following operations have been removed from the OperationName enum, as they were never used to assemble operations:

  • OperationName.mint
  • OperationName.predicatecall
  • OperationName.script
  • OperationName.sent

#3552 - Remove receipts deprecated properties

All receipts deprecated properties were removed:

// before
ReceiptCall.from

ReceiptLog.val0
ReceiptLog.val1
ReceiptLog.val2
ReceiptLog.val3

ReceiptLogData.val0
ReceiptLogData.val1

ReceiptTransfer.from

ReceiptTransferOut.from
// after
ReceiptCall.id

ReceiptLog.ra
ReceiptLog.rb
ReceiptLog.rc
ReceiptLog.rd

ReceiptLogData.ra
ReceiptLogData.rb

ReceiptTransfer.id

ReceiptTransferOut.id

#3551 - Remove receipt coders

All previously deprecated receipt coders have been removed. These classes were barely used aside from a few internal helpers, which were converted to utility functions.

// before
const messageId = ReceiptMessageOutCoder.getMessageId({
  sender,
  recipient,
  nonce,
  amount,
  data,
});

const assetId = ReceiptMintCoder.getAssetId(contractId, subId);

const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
// after
import { getMessageId, getAssetId } from 'fuels'

const messageId = getMessageId({
  sender,
  recipient,
  nonce,
  amount,
  data,
});

const assetId = getAssetId(contractId, subId);

#3548 - Remove deprecated submitAndAwait operation

  • submitAndAwait operation was removed

After being deprecated since #3101, we have removed this operation altogether. Please use the submitAndAwaitStatus method instead which gives the same results as submitAndAwait. If you are interested in the deprecation/removal reasons, please refer to FuelLabs/fuel-core#2108.

// before
const response = await provider.operations.submitAndAwait(txRequest);
// after
const response = await provider.operations.submitAndAwaitStatus(txRequest);

#3493 - Remove Bech32 address

  • We no longer support Bech32 addresses
// before
import { Address, Bech32Address } from "fuels";

const bech32Address: Bech32Address = "fuel1234";
const address = new Address(bech32Address);
// after
import { Address, B256Address } from "fuels";

const b256Address: B256Address = "0x1234";
const address = new Address(b256Address);
  • Removed INVALID_BECH32_ADDRESS error code.

  • Removed associated Bech32 helper functions.

    • normalizeBech32
    • isBech32
    • toB256
    • getBytesFromBech32
    • toBech32
    • clearFirst12BytesFromB256

#3492 - Redistributed the @fuel-ts/interfaces package

  • Removed the AbstractAddress class; use the Address class instead.
// before
import { AbstractAddress } from 'fuels';
// after
import { Address } from 'fuels';
  • Removed the @fuel-ts/interfaces package; use the fuels package instead.
// before
import { BytesLike } from '@fuel-ts/interfaces'
// after
import { BytesLike } from 'fuels'

Copy link

vercel bot commented Jan 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 6:56pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 6:56pm
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 6:56pm

@fuel-service-user fuel-service-user force-pushed the changeset-release/master branch from 3d255ba to 07e4a32 Compare January 2, 2025 09:20
@fuel-service-user fuel-service-user force-pushed the changeset-release/master branch from 07e4a32 to 9f976f2 Compare January 2, 2025 10:43
@fuel-service-user fuel-service-user force-pushed the changeset-release/master branch 2 times, most recently from 0ecec63 to c1ae347 Compare January 2, 2025 11:55
@fuel-service-user fuel-service-user force-pushed the changeset-release/master branch from c1ae347 to a3f28bf Compare January 2, 2025 12:21
@fuel-service-user fuel-service-user changed the title ci(release): v0.97.3 @ master ci(release): v0.98.0 @ master Jan 2, 2025
@fuel-service-user fuel-service-user force-pushed the changeset-release/master branch from a3f28bf to 7a4a172 Compare January 2, 2025 12:49
@fuel-service-user fuel-service-user force-pushed the changeset-release/master branch from 7aaed63 to 3c23c67 Compare January 7, 2025 10:25
@fuel-service-user fuel-service-user force-pushed the changeset-release/master branch from 3c23c67 to 32663a9 Compare January 7, 2025 11:01
@fuel-service-user fuel-service-user force-pushed the changeset-release/master branch from 32663a9 to bc582dc Compare January 7, 2025 12:00
@fuel-service-user fuel-service-user force-pushed the changeset-release/master branch from bc582dc to 87ac5b2 Compare January 7, 2025 12:25
@fuel-service-user fuel-service-user force-pushed the changeset-release/master branch from 87ac5b2 to 9a92907 Compare January 7, 2025 12:55
@fuel-service-user fuel-service-user force-pushed the changeset-release/master branch from 9a92907 to 4c3dd12 Compare January 7, 2025 16:18
Copy link
Contributor

github-actions bot commented Jan 7, 2025

Coverage Report:

Lines Branches Functions Statements
76.94%(-0.03%) 70.35%(-0.14%) 74.98%(-0.04%) 76.95%(-0.02%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/address/src/address.ts 90.9%
(-0.17%)
86.66%
(+0%)
85.71%
(+0%)
91.07%
(-0.15%)
🔴 packages/address/src/utils.ts 69.23%
(-9.03%)
50%
(-21.42%)
77.77%
(-9.73%)
70.37%
(-8.79%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant